﻿//no-tabs solution
$(document).ready(function () {
    $(".panel.collapsible-panel >.panel-heading").click(WrapAndSaveBlockData);
});
function WrapAndSaveBlockData() {
    $(this).parents(".panel").find(">.panel-container").slideToggle();
    $("#ajaxBusy span").addClass("no-ajax-loader");
    var icon = $(this).find("i.toggle-icon");
    if ($(this).hasClass("opened")) {
        icon.removeClass("fa-minus");
        icon.addClass("fa-plus");
    } else {
        icon.addClass("fa-minus");
        icon.removeClass("fa-plus");
    }
    $(this).toggleClass("opened");
}

//index头部查询区域高度
function seachHeight() {
    var winH = $(window).height();
    $("#requireHide").click(function () {
        var requireH = $(".search-require").height();
        var contentH = $(".content-zl").height();
        $(".search-require").slideToggle(0);
        $(this).toggleClass("glyphicon-chevron-down");
        if ($(".search-require").css("display") == "none") {
            var contentH2 = contentH + requireH;
            $(".content-zl").height(contentH2);
            $("#gridList").setGridHeight(contentH2 - 130);
        } else {
            var contentH3 = contentH - requireH;
            $(".content-zl").height(contentH3);
            $("#gridList").setGridHeight(contentH3 - 130);
        }
    });

    //var winHeight = $(window).height();
    var winWidth = $(window).width();
    if (winWidth > 1050) {
        $(".search-require>.container-fluid>.row>div").removeClass("col-md-6");
        $(".search-require>.container-fluid>.row>div").addClass("col-md-4");
    } else if (900 < winWidth < 1050) {
        $(".search-require>.container-fluid>.row>div").removeClass("col-md-4");
        $(".search-require>.container-fluid>.row>div").addClass("col-md-6");
    }


    var searchH = $(".search-area").height();
    $(".content-zl").height(winH - searchH - 35);

}

